package com.zyh.em.evaluate;

import com.zyh.em.entity.EvaluateData;
import com.zyh.em.entity.EvaluateReport;
import com.zyh.em.entity.HistoryData;

import java.util.List;

public class DeviceEvaluate extends AbstractEvaluate{
    @Override
    public void evaluate(EvaluateData evaluateData, HistoryData historyData, EvaluateReport evaluateReport,EvaluateChain evaluateChain) {
        List<String> devices = historyData.getDevices();
        String device = evaluateData.getDevice();
        if (devices==null || device.isEmpty() || devices.contains(device)){
            evaluateReport.setRiskFactor("device",false);
        }else {
            evaluateReport.setRiskFactor("device",true);
        }
        evaluateChain.doEvaluate(evaluateData, historyData, evaluateReport);
    }
}
